Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebuild script #71

Merged
merged 4 commits into from
Aug 14, 2024
Merged

Prebuild script #71

merged 4 commits into from
Aug 14, 2024

Conversation

jordanstephens
Copy link
Member

@jordanstephens jordanstephens commented Aug 8, 2024

This PR makes two changes to make it more ergonomic to test doc deployment locally.

  1. Factor out npm run prebuild script to handle the following:
    a. navigating to the cli repo and running gendocs
    b. running prep-cli-docs to prepare frontmatter for each page
    c. running prep-samples to build a page for each sample
  2. I tried to checkout samples and defang into sibling directories to more closely mirror our local development environments so we could more easily cd defang-docs && npm run build locally, but i ran into Unable to clone outside of GITHUB_WORKSPACE directory actions/checkout#197. To try to preserve my intended user experience, I hacked around this by adding some complexity to the prebuild.sh script which checks for the presence of sibling directories first, then falls back to child directories.

The prebuild script will automatically be run when npm run build is executed.

github actions prevents cloning a repo outside of the current working
directory: actions/checkout#197
@raphaeltm
Copy link
Contributor

@jordanstephens LGTM, though I have this one question: #71 (comment)

If we can just make the CI directory structure consistent with local dev, I think that would be nicer, but I'm guessing it's just not possible in GitHub Actions?

@jordanstephens jordanstephens merged commit 8c16b5c into main Aug 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants